/**
 * 接收来自平台的消息
 * @param {Number} platform 	平台码
 * @param {String} msg			消息指令
 * @param {String} extend		扩展数据，json格式的字符串
 */
var sendMessage = function(msg, extend, platcode) {
	if (msg === 'back') {
		App.Router.goBack();
	}
};

/**
 * 向端发送信息
 * @param {String} msg			消息指令
 * @param {String} extend		扩展数据，json格式的字符串
 */
var callbackPlatform = function(msg, extend) {
	msg = msg || "";
	extend = extend || "";
	console.log("call msg:" + msg + ", extend:" + extend);
	if (window.platform) {
		window.platform.receiveMessage(msg, extend);
	}
	document.location = "objc://receiveMessage/"+msg;
}
